package com.xuecheng.content.controller;

import com.xuecheng.api.content.model.dto.CourseBaseDTO;
import com.xuecheng.api.content.model.qo.QueryCourseModel;
import com.xuecheng.common.domain.page.PageRequestParams;
import com.xuecheng.common.domain.page.PageVO;
import com.xuecheng.common.util.SecurityUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.xuecheng.content.service.CourseBaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.security.Security;

/**
 * <p>
 * 课程基本信息 前端控制器
 * </p>
 *
 * @author itcast
 */
@Slf4j
@RestController
@RequestMapping
public class CourseBaseController {

    @Autowired
    private CourseBaseService  courseBaseService;

    @PostMapping("course/list")
    public PageVO queryCourseList(PageRequestParams params, @RequestBody QueryCourseModel model){

        Long companyId = SecurityUtil.getCompanyId();

        PageVO<CourseBaseDTO> pageVO = courseBaseService.queryCourseList(params, model,companyId);

        return pageVO;
    }
}
